//
//  HomeWebViewController.swift
//  我的微博
//
//  Created by mac on 15/9/21.
//  Copyright © 2015年 szh. All rights reserved.
//

import UIKit
import SVProgressHUD

class HomeWebViewController: UIViewController, UIWebViewDelegate {
    
    /// 要加载的 url
    var url: NSURL?
    
    override func loadView() {
        view = webView
        
        webView.delegate = self
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        title = "网页"
        
        // 加载 url
        if url != nil {
            webView.loadRequest(NSURLRequest(URL: url!))
        }
    }
    
    func webViewDidStartLoad(webView: UIWebView) {
        SVProgressHUD.show()
    }
    
    func webViewDidFinishLoad(webView: UIWebView) {
        SVProgressHUD.dismiss()
    }
    
    // MARK: - 懒加载控件
    private lazy var webView = UIWebView()
}
